Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(symbolicator): implement deployment and statefulset selection #1453

Merged
merged 3 commits into from
Sep 14, 2024

Conversation

patsevanton
Copy link
Contributor

@patsevanton patsevanton commented Sep 14, 2024

@Mokto This pull request introduces the ability to choose between Deployment and StatefulSet for the symbolicator service. Additionally, it allows configuring PersistentVolumeClaim or emptyDir for data persistence.

Deployment and StatefulSet Selection:

  • Added a new value symbolicator.api.usedeployment in values.yaml to toggle between Deployment and StatefulSet.
  • Updated deployment-symbolicator.yaml to include the usedeployment condition.
  • Created statefulset-symbolicator.yaml for the StatefulSet configuration.

Persistence Configuration:

  • Added symbolicator.api.persistence options in values.yaml to configure PersistentVolumeClaim or emptyDir.
  • Updated both deployment-symbolicator.yaml and statefulset-symbolicator.yaml to use the new persistence configuration.

Values.yaml Updates:

  • Added usedeployment and persistence options under symbolicator.api in values.yaml.

@patsevanton
Copy link
Contributor Author

patsevanton commented Sep 14, 2024

tested:

 helm install -n test --wait sentry . --values values.yaml --timeout=1000s
coalesce.go:237: warning: skipped value for kafka.config: Not a table.
NAME: sentry
LAST DEPLOYED: Sat Sep 14 14:38:50 2024
NAMESPACE: test
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
* When running upgrades, make sure to give back the `system.secretKey` value.

kubectl -n test get configmap sentry-sentry -o json | grep -m1 -Po '(?<=system.secret-key: )[^\\]*'

values.yaml

symbolicator:
  enabled: false
  api:
    usedeployment: true  # Set true to use Deployment, false for StatefulSet
    persistence:
      enabled: true  # Set true for using PersistentVolumeClaim, false for emptyDir
      accessModes: ["ReadWriteOnce"]
      # storageClassName: standard
      size: "10Gi"

@patsevanton
Copy link
Contributor Author

patsevanton commented Sep 14, 2024

symbolicator:
  enabled: true
  api:
    usedeployment: false  # Set true to use Deployment, false for StatefulSet
    persistence:
      enabled: true  # Set true for using PersistentVolumeClaim, false for emptyDir
      accessModes: ["ReadWriteOnce"]
      # storageClassName: standard
      size: "10Gi"

k get sts -n test sentry-symbolicator-api -o yaml

apiVersion: apps/v1
kind: StatefulSet
metadata:
  annotations:
    meta.helm.sh/release-name: sentry
    meta.helm.sh/release-namespace: test
  creationTimestamp: "2024-09-14T09:40:10Z"
  generation: 1
  labels:
    app: sentry
    app.kubernetes.io/managed-by: Helm
    chart: sentry-25.5.1
    heritage: Helm
    release: sentry
  name: sentry-symbolicator-api
  namespace: test
  resourceVersion: "541669"
  uid: e89912ae-c825-4c1a-bf8f-e5e07fdb005f
spec:
  persistentVolumeClaimRetentionPolicy:
    whenDeleted: Retain
    whenScaled: Retain
  podManagementPolicy: OrderedReady
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: sentry
      release: sentry
      role: symbolicator-api
  serviceName: sentry-symbolicator-api
  template:
    metadata:
      annotations:
        checksum/config.yaml: af24832c18203921a4d4de61ca17e827d713479585be7f6488ddaeb0151e4149
      creationTimestamp: null
      labels:
        app: sentry
        release: sentry
        role: symbolicator-api
    spec:
      containers:
      - args:
        - run
        - -c
        - /etc/symbolicator/config.yml
        image: getsentry/symbolicator:24.5.1
        imagePullPolicy: IfNotPresent
        livenessProbe:
          failureThreshold: 5
          httpGet:
            path: /healthcheck
            port: 3021
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2
        name: sentry-symbolicator
        ports:
        - containerPort: 3021
          protocol: TCP
        readinessProbe:
          failureThreshold: 10
          httpGet:
            path: /healthcheck
            port: 3021
            scheme: HTTP
          initialDelaySeconds: 10
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 2
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/symbolicator
          name: config
          readOnly: true
        - mountPath: /data
          name: symbolicator-data
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: sentry-symbolicator
        name: config
  updateStrategy:
    rollingUpdate:
      partition: 0
    type: RollingUpdate
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      creationTimestamp: null
      name: symbolicator-data
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      volumeMode: Filesystem
    status:
      phase: Pending
status:
  availableReplicas: 1
  collisionCount: 0
  currentReplicas: 1
  currentRevision: sentry-symbolicator-api-7bc9bc7c7f
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  updateRevision: sentry-symbolicator-api-7bc9bc7c7f
  updatedReplicas: 1

@Mokto Mokto merged commit 112c1b5 into sentry-kubernetes:develop Sep 14, 2024
2 checks passed
@Mokto Mokto mentioned this pull request Sep 14, 2024
@patsevanton patsevanton deleted the symbolicator-sts branch September 16, 2024 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants